<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <head th:include="views/public"/>
</head>
<body class="layui-view-body">
    <div id="vm" class="layui-content">
        <div style="margin-left: 1%;padding-top: 1%">
            <el-form :model="form" ref="form1" :inline="true" label-width="68px">
                <el-form-item label="用户名称">
                    <el-input   placeholder="请输入用户名称" v-model="form.loginName"  clearable size="small" class="search-input" @keyup.enter.native="search"/>
                </el-form-item>
                <el-form-item label="IP">
                    <el-input   placeholder="请输入IP地址" v-model="form.ipaddr"  clearable size="small" class="search-input" @keyup.enter.native="search"/>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" icon="el-icon-search" size="mini" @click="search">搜索</el-button>
                    <el-button icon="el-icon-refresh" size="mini" @click="reset('form1')">重置</el-button>
                    <el-button-group>
                        <el-tooltip class="item" effect="Light" content="强退" placement="bottom">
                            <el-button type="primary" size="mini" @click="out" icon="el-icon-plus"></el-button>
                        </el-tooltip>
                        <el-tooltip class="item" effect="Light"  content="不勾选导出全部数据" placement="bottom">
                            <el-button type="primary"   size="mini" @click="exportData" icon="el-icon-download"></el-button>
                        </el-tooltip>
                    </el-button-group>
                </el-form-item>
            </el-form>
        </div>
        <template>
            <el-table  ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 98%;margin-left: 1%" @selection-change="selectionChange">
                <el-table-column type="selection" width="55"> </el-table-column>
                <el-table-column prop="sessionId" label="会话ID" width="300"> </el-table-column>
                <el-table-column prop="loginName" label="姓名"> </el-table-column>
                <el-table-column prop="deptName" label="部门"> </el-table-column>
                <el-table-column prop="ipaddr" label="IP"> </el-table-column>
                <el-table-column prop="loginLocation" label="登录地址"> </el-table-column>
                <el-table-column prop="browser" label="浏览器"> </el-table-column>
                <el-table-column prop="os" label="操作系统"> </el-table-column>
                <el-table-column prop="startTimestamp" label="登录时间" width="150"> </el-table-column>
                <el-table-column prop="lastAccessTime" label="最后活跃时间" width="150"> </el-table-column>
                <el-table-column fixed="right" label="操作" width="100">
                    <template slot-scope="scope">
                        <el-button type="text" size="small" @click="out(scope.$index, scope.row)">强退</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </template>
        <!--page-->
        <div class="block" style="padding-top: 1%">
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="form.page"
                    :page-sizes="[10, 30, 50, 100, 300]" background :page-size="form.limit" layout="total, sizes, prev, pager, next, jumper"
                    :total="count">
            </el-pagination>
        </div>
    </div>
    <script th:src="@{/assets/js/moni/user_online.js}"></script>
</body>
</html>